import os
import shutil

# 移动文件
try:
    shutil.move("./dist/Music/like_list.json", "./dist")
except FileNotFoundError:
    pass
# 删除安装目录
try:
    shutil.rmtree('./dist/Music')
except FileNotFoundError:
    pass
# 安装
os.system("pyinstaller -D Music.py -n Music -i Ico.png -w")
# 移动文件
try:
    shutil.move("./dist/like_list.json", "./dist/Music")
except FileNotFoundError:
    pass
try:
    shutil.copy("Ico.png", "./dist/Music")
except FileExistsError:
    pass
